<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="renderer" content="webkit">
<title>学员自主约车</title>
<link rel="stylesheet" href="<%=path%>/CSS/responsive.css">
<link href="<%=path%>/CSS/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
*{margin:0px;padding:0px;}
.main{width: 100%;height:1000px;background: #ffffff;}
.container{margin-left: auto;margin-right: auto;padding-left: 15px;padding-right: 15px;width: 800px;}
.centent{width: 800px;padding-bottom: 400px}
.centent div label{color: #444444;font-size: 14px;}
.centent-div{text-align: center;}
.cerno{height: 30px;margin-left: 10px;color: #999999;background: #ffffff;border: 1px solid #cccccc;padding-left: 10px;width:170px;outline: none}
.scbtn{background: #57a0ff;border-radius:20px;width: 110px;height: 35px;outline: none;color: #ffffff;margin-left: 50px}
</style>
</head>
<body>
<div class="main">

	<div style="height: 300px">
	
	</div>
	<div class="container">
		<div class="centent">
			<div class="centent-div">
				<label>身份证号码</label>
                <input type="text" class="cerno" placeholder="请输入身份证号码" value="360121199405874521">
                <input type="button" class="scbtn" id="selStuAscard" value="确   定">
			</div>
		</div>
	</div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<script type="text/javascript">
    /*提交身份证号码*/
    $('#selStuAscard').click(function () {
        var cerno = $('.cerno').val().trim();
        if (isCardNo(cerno)) {
            $.ajax({
                url: '<%=path%>/DrivingSys/weixin/kmyy/queryStudentByIdCard',
                type: "post",
                data: {'cerno': cerno},
                dataType: "json",
                success: function (res) {
                    if (res == null) {
                        alert('您还未报名，请去服务台报名！')
                    } else {
                        location = '<%=path%>/DrivingSys/weixin/kmyy/CalculateTimeKmyyPc?fid=' + res.fid;
                    }
                },
                error: function () {
                    alert('您还没有报名!');
                }
            });
        }
    })
    function isCardNo(card) {
// 身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X
        var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
        if (reg.test(card) === false) {
            alert("身份证输入不合法");
            return false;
        }
        else {
            return true;
        }
    }
</script>
</html>